<?php if (have_posts()) : while (have_posts()) : the_post();
	if (isset($_POST['featurevid'])){
		$custom = get_post_custom($post->ID);
		$featurevid = $custom['featurevid'][0];
	}
?>

<h1 class="headline"><?php the_title(); ?></h1>

<div class="post-author">
	<p class="align-left">
		<span><i class="icon-time"></i> &nbsp;<?php the_time(__("F j, Y", 'vnnews')); ?></span>
		<span><i class="icon-user"></i> &nbsp;<?php _e("By: ", 'vnnews'); ?><?php esc_url ( the_author_posts_link() ); ?></span>
		<span><i class="icon-folder-open"></i> &nbsp;<?php _e("Category:", 'vnnews'); ?> <?php the_category(', '); ?></span>
	</p>
	<p class="align-right">
		<i class="icon-comment"></i> &nbsp;<a class="scroll" href="<?php the_permalink(); ?>#comments"><?php comments_number(__("Leave a Comment", 'vnnews'), __("1 comment", 'vnnews'), '% comments'); ?></a>
	</p>
</div>

<?php if (has_post_format('gallery')) {

		get_template_part( 'content/gallery', 'slider' );

	} else {

		if(of_get_option('display_feature_post') == '1') {
			if ( get_post_meta($post->ID, 'featurevid', true) ) { ?>
			<div class="feature-vid"><?php echo get_post_meta($post->ID, 'featurevid', true); ?></div>
		<?php } else {
				if ( has_post_thumbnail()) { ?>
				<div class="feature-img"><?php the_post_thumbnail( 'featured-large' ); ?></div>
			<?php }
			}
		}

	}

	//BEGIN Advertisement on bottom post
	if(of_get_option( 'enable_adv_top_post') == '1'){
		echo vnnews_display_advertisement('top');
	}

	the_content();

	$tag_list = get_the_tag_list( __( ", ", 'organization' ) );

	if ( ! empty( $tag_list ) ) { ?>
		<div class="post-meta radius-full">
			<p>
				<i class="icon-tags"></i> &nbsp;<?php _e("Tags: ", 'organization'); ?> <?php the_tags(''); ?>
			</p>
		</div>
<?php } ?>

<div class="clearfix"></div>

<!-- BEGIN Advertisement on bottom post -->
<?php
	if(of_get_option( 'enable_adv_bottom_post') == '1'){
		echo vnnews_display_advertisement('bottom');
	}
?>

<?php if (of_get_option("display_social_post") == "1"): ?>
	<!-- BEGIN .share-button -->
	<div class="share-button clearfix">
		<span class='st_facebook_large' displayText='Facebook'></span>
		<span class='st_twitter_large' displayText='Tweet'></span>
		<span class='st_googleplus_large' displayText='Google +'></span>
		<span class='st_linkedin_large' displayText='LinkedIn'></span>
		<span class='st_pinterest_large' displayText='Pinterest'></span>
	</div>
	<!-- END .share-button -->
<?php endif; ?>
<!-- BEGIN .post-related -->
<?php
	$enable_related_post = of_get_option('enable_related_post');
	if($enable_related_post == '1'):
?>

<div class="post-ralated clearfix">
	<?php
		$number_related_post = of_get_option('number_related_post');
		$title_related_post = of_get_option('title_related_post');

		$number_related_post = empty($number_related_post) ? 4 : $number_related_post;
		$title_related_post = empty($title_related_post) ? "Related news :" : $title_related_post;

		echo vnnews_related_posts( $title_related_post, $number_related_post);
	?>
</div>
<!-- END .post-related -->

<?php endif; ?>

<?php if ( comments_open() || '0' != get_comments_number() ) comments_template(); ?>

<?php setPostViews(get_the_ID()); ?>

<div class="clear"></div>

<?php endwhile; else: ?>

<p><?php _e("Sorry, no posts matched your criteria.", 'vnnews'); ?></p>

<?php endif; ?>